The greater the amount of audio data compression, the greater the duration of sound a given microcontroller is able store, therefore, many attempts have been made over the past several decades to improve the compression of audio data for use in microcontrollers having limited processing power and storage capabilities. However, typical audio data compression schemes that reduce distortion to acceptable levels require processing power in excess of that available in many low-cost products.
A typical audio data compression technique, adaptive differential pulse code modulation (ADPCM), is derived from a pulse code modulation (PCM) scheme in which an analog signal (signal) amplitude is sampled at regular intervals. ADPCM is a reduced bit-rate variant of PCM audio encoding.
With PCM, the sampling rate is typically several times the highest frequency of the signal. The amplitude of the signal at each sample is quantized (i.e., rounded off to the nearest of several specific and predetermined levels). The levels are represented by a number of counts, so the output of a PCM compression scheme is a series of binary numbers constituting a digital signal.
An ADPCM compression scheme produces a digital signal with a lower bit rate than PCM by encoding only the difference between samples (delta value) and adjusting the encoding scale dynamically to accommodate variation in the magnitude of the sample difference. ADPCM, though not difficult to implement, introduces a high level of noise. Typically, an ADPCM system is a band compression system in which the prediction of signal amplitude at present, is based upon a previous sample or samples. The basis for such a prediction scheme is that for many instances of audio data (e.g., speech signals), the proximate samples are highly correlated.
ADPCM achieves bit rate reduction through the use of adaptive prediction and adaptive quantization. ADPCM sampling is typically performed at 8 KHz with 3 or 4 bits used to describe the difference between adjacent samples. A typical ADPCM scheme can achieve a 2:1 compression ratio by representing an 8-bit signal through encoded 4-bit delta values with reasonable quality.
ADPCM uses variable gain depending upon the variation in amplitude (motion) of the signal. That is, ADPCM is effected based upon an assumption that the signal will have periods of small amplitude and periods of large amplitude; this is typical of speech and many other audio signals. Encoding the deltas as 4-bit values means that only 4 bits are stored to memory regardless of whether the 4 bits pertain to a high-amplitude portion of the signal or a low-amplitude portion of the signal. Using 4 bits provides sixteen resolution levels that may be represented as eight positive levels and seven negative levels (or vice versa), together with a zero level. An alternative representation may be seven positive levels and seven negative levels with two zero levels, one of which may not be used.
When a typical ADPCM scheme is employed to encode an 8-bit signal through encoded 3-bit delta values (i.e., a compression ratio of approximately 2.6:1), an unacceptable amount of distortion to the original signal results. A 3-bit encoding provides only eight resolution levels that may be represented as four positive levels and three negative levels (or vice versa), together with a zero level. Again an alternative representation may be three positive levels and three negative levels with two zero levels, one of which may not be used. While having four resolution levels provides an acceptable level of quality for many applications, three resolution levels does not. This means a 3-bit encoding scheme (2.6:1 compression) is undesirable for many applications, thus limiting the duration of sound that a given microcontroller is able store.
Of course, with a greater amount of processing power and memory resources, other sophisticated methods and systems can be employed (e.g., CELP) that achieve greater compression ratios for audio data, while limiting distortion to acceptable levels. These systems are not practical for many applications employing microprocessors with limited processing capabilities.